#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<string.h>
char* my_strncpy(char* dest, const char* src, size_t num)
{
	assert(dest && src);
	char* cur = dest;
	while (num--)
	{
		*dest = *src;
		dest++;
		src++;
	}
	return cur;
}
int main()
{
	char arr1[10] = "abcdefg";
	char arr2[10] = "lllllllll";
	char* ret = my_strncpy(arr1, arr2, 4);
	printf("%s\n", ret);
	return 0;
}